package com.nwpu.coursesupport.mapper;

import com.nwpu.coursesupport.criteria.ClassViewSearchCriteria;
import com.nwpu.coursesupport.criteria.StudentInCourseSearchCriteria;
import com.nwpu.coursesupport.entity.Class;
import com.nwpu.coursesupport.entity.Student;
import com.nwpu.coursesupport.entity.Teacher;
import com.nwpu.coursesupport.view.ClassView;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ClassMapper extends BaseMapper<Class>{

	public ClassView getClassView(ClassViewSearchCriteria sc);

    public List<Integer> findStudentByClassId(int classId);

    public List<Student> getStudentByCourseId(StudentInCourseSearchCriteria sc);

    public Teacher getTeacherByClassId(int id);

    public boolean updateClassLesson(Class cl);

    @Select("select * from class where course_id=#{courseId}")
    List<Class> findByCourseId(@Param("courseId") Integer courseId);
}
